package com.woniu.shops.config;

import com.woniu.shops.loginInterceptor.LoginInterceptors;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/*@Configuration*/
public class WebMvcConfigs implements WebMvcConfigurer {
    @Resource
    private LoginInterceptors loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns(
                        "/shops/login",
                        "/user/login",
                        "/shops/getTook",
                        "/captcha/getVerifyCodeImage",
                        "/file/upload"
                );
    }


}